package com.atguigu.flink.chapter05.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;
import java.util.List;

/**
 * @Author lzc
 * @Date 2022/7/4 11:10
 */
public class Flink02_Source_Collection {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        List<Integer> list = Arrays.asList(10,20,30,40,50);
    
    
        /*DataStreamSource<Integer> stream = env.fromCollection(list);
        stream.print();*/
    
        DataStreamSource<Integer> stream = env.fromElements(10, 20, 30, 40);
        stream.print();
    
    
        env.execute();
    }
}
